import menuList from "../config/menuConfig";

let checkTitle = (pathname) => {
  let title = "";
  menuList.forEach((value) => {
    if (value.key === pathname) {
      title = value.title;
    }
    if (value.children) {
      value.children.forEach((value1) => {
        if (value1.key === pathname) {
          title = value1.title;
          return;
        }
      });
    }
  });
  return title;
};
export default checkTitle;
